package com.example.mapper;

import com.example.pojo.Salary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SalaryMapper {

    @Select("SELECT * FROM salaries WHERE employeeId = #{employeeId}")
    Salary getSalaryByEmployeeId(@Param("employeeId") String employeeId);

    @Update("UPDATE salaries SET basicSalary = #{basicSalary}, bonus = #{bonus}, personalTax = #{personalTax}, nationalTax = #{nationalTax}, healthInsurance = #{healthInsurance}, retirementInsurance = #{retirementInsurance}, netSalary = #{netSalary} WHERE employeeId = #{employeeId}")
    void updateSalary(Salary salary);
}
